Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Regex repairs and epoch stripping fix #410

Merged
merged 3 commits into from
Jan 12, 2021
Merged

Regex repairs and epoch stripping fix #410

merged 3 commits into from
Jan 12, 2021

Conversation

mgrabovsky
Copy link
Contributor

  • The changes in 84d67af made the regexes accept more inputs as valid than originally intended due to the use of \w, \d, etc. This commit changes the regexes to be equivalent to the previous state.
  • Repair how epoch number is stripped from package designation in NEVR(A) form.
  • Minor code style fixes.

Follow-up to #409

The changes in 84d67af made the regexes accept more inputs as valid than
originally intended due to the use of PCRE shorthands (\w, \d, etc.).
This commit partially reverts to the original and adds the ASCII flag to
`re.compile()` to ensure only characters in the ASCII range are
accepted for the shorthands.
The epoch number in the NEVR form appears just after the package name
so stripping any text before it completely breaks the system.

After this change, the first number followed by a colon (if any such is
present) is removed, since this must be the epoch.
* Refactor control flow in a Pythonic style.
* Replace a needless list comprehension with a generator.
* Use format string literals.
@packit-as-a-service
Copy link

Congratulations! One of the builds has completed. 🍾

⚠️ Please note that our current plans include removal of these comments in the near future (at least 2 weeks after including this disclaimer), if you have serious concerns regarding their removal or would like to continue receiving them please reach out to us. ⚠️

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/abrt-retrace-server-410
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@xsuchy xsuchy merged commit 50f6676 into master Jan 12, 2021
@mgrabovsky mgrabovsky deleted the parsing-regexes2 branch January 12, 2021 13:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants